# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=gxr
pkgver=0.15.2
pkgrel=2
pkgdesc="A glib wrapper for the OpenVR and the OpenXR APIs"
url="https://gitlab.freedesktop.org/xrdesktop/gxr"
arch="all"
license="MIT AND CC-BY-SA-4.0"
depends_dev="
	json-glib-dev
	openxr-dev
	"
makedepends="$depends_dev
	cmd:glslangValidator
	gtk-doc
	gtk+3.0-dev
	gulkan-dev
	meson
	"
source="https://gitlab.freedesktop.org/xrdesktop/gxr/-/archive/$pkgver/gxr-$pkgver.tar.gz
	fix-build.patch
	"
subpackages="$pkgname-dev"

build() {
	abuild-meson \
		-Dapi_doc=true \
		-Dtests=false \
		. output
	meson compile ${JOBS:+-j ${JOBS}} -C output
}

check() {
	# The XR tests require a working VR setup
	meson test --no-rebuild -v -C output --no-suite gxr:xr --no-suite post-install
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="163222de668ac9de6e2438d70f2ae850fe927e29fc7d5cd318c549e1c275626481171632047393d30973e76ceaddad1c1d2dc8f09e0403204194d2c25dfbcdb6  gxr-0.15.2.tar.gz
247bf4df132f05e9792e73d674f5887a84508398233fa13e8d39e7788a3916a15ab05175f6504ebddff38d1e3d88eea051acf6afc1d0758fcd9f8f0022cf28d6  fix-build.patch"
